<template>
  <div class="content_nav">
    <ul v-for="(item, index) in lists" :key="index">
      <li>
        <a>{{ item.name }}</a>
        <a @click.prevent="getTo(item.id)"><div class="mask"></div></a>
 
        
      </li>
    </ul>
  </div>
</template>

<script>
export default {
    props:['id'],
  data() {
      
    return {
      lists: [
        { id: 1, name: "查询图书" },
        { id: 2, name: "快速服务" },
        { id: 3, name: "电子资源" },
        { id: 4, name: "热门图书" },
        { id: 5, name: "最新活动" },
      ],
    };
  },
  methods:{
      getTo(id){
        //   console.log(id);

        switch (id) {
            case 1:
                this.$router.push('/chaxun')
                break;
        
            case 4:
                this.$router.push('/hootBox')
                break
        }
      }
  }

};
</script>

<style >
/*第二个导航*/

.content_nav {
  display: flex;
  flex-direction: row;
  width: 1200px;
  margin: 0 auto;
}
.content_nav ul {
  list-style: none;
  width: 100%;
  margin: 0px;
  padding: 0px;
  margin-top: 10px;
  cursor: pointer;
  position: relative;
}
.content_nav :last-child {
  border-right: 0;
  border-top: 2px;
  border-radius: 2px;
}
.content_nav ul :first-child {
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}
.content_nav ul li a {
  text-decoration: none;
  width: 227px;
  height: 85px;
  display: block;
  font-weight: bold;
  color: #9a9d9e;
  font-size: 25px;
}
.content_nav ul {
  overflow: hidden;
  display: flex;
  flex-direction: row;
}
.content_nav li {
  background-color: #fff;
  border-right: 1px solid #8b8d8e;
  height: 85px;
  text-align: center;
  line-height: 85px;
  margin: 0 5px;
}
/* .content_nav ul li .router-link-exact-active {
  text-decoration: none;
} */

/* 遮罩 */
.content_nav .mask {
  width: 228px;
  height: 85px;
  background: rgba(33, 150, 243, 0.5);
  opacity: 0.5;
  position: absolute;
  transition: 0.5s;
}
.content_nav li:hover .mask {
  transform: translatey(-85px);
}

.content_nav li:hover a {
  color: black;
}
</style>